class PurchaseEvaluationTemplate {
  String? id;
  String? templateName;
  String? templateComment;
  String? createUid;
  String? createDate;

  PurchaseEvaluationTemplate({
    this.id,
    this.templateName,
    this.templateComment,
    this.createUid,
    this.createDate,
  });

  PurchaseEvaluationTemplate copyWith({
    String? id,
    String? templateName,
    String? templateComment,
  }) {
    return new PurchaseEvaluationTemplate(
      id: id ?? this.id,
      templateName: templateName ?? this.templateName,
      templateComment: templateComment ?? this.templateComment,
    );
  }

  @override
  String toString() {
    return '''PurchaseEvaluationTemplate{
      id: id,
      templateName: templateName,
      templateComment: templateComment,
    }''';
  }

  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      (other is PurchaseEvaluationTemplate &&
          runtimeType == other.runtimeType &&
          id == other.id &&
          templateName == other.templateName &&
          templateComment == other.templateComment);

  factory PurchaseEvaluationTemplate.fromMap(Map<String, dynamic> map) {
    return new PurchaseEvaluationTemplate(
      id: map['id'] != false ? map['id'].toString() : "",
      templateName: map['template_name'] != false
          ? map['template_name'].toString() as String?
          : "",
      templateComment: map['template_comment'] != false
          ? map['template_comment'].toString() as String?
          : "",
      createUid: map['create_uid'] != false
          ? map['create_uid'][1].toString() as String?
          : "",
      createDate: map['create_date'] != false
          ? map['create_date'].toString() as String?
          : "",
    );
  }

  Map<String, dynamic> toMap() {
    // ignore: unnecessary_cast
    return {
      'id': this.id,
      'templateName': this.templateName,
      'templateComment': this.templateComment,
    } as Map<String, dynamic>;
  }

  List toDomainList() {
    List list = [
      if (this.templateName != null && this.templateName != '')
        ['template_name', 'like', '%${this.templateName}%'],
    ] as List;
    // if (list.length == 0) {
    //   list.add(['id', '!=', null]);
    // }
    // ignore: unnecessary_cast
    return list;
  }

  Map<String, dynamic> toOdooMap() {
    // ignore: unnecessary_cast
    return {
      'id': this.id,
      'template_name': this.templateName,
      'template_comment': this.templateComment,
    } as Map<String, dynamic>;
  }

//</editor-fold>

}
